/**
* Forms
* ============================================================================
*/

.form-control {
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.04);
  height: auto;
  border: 1px solid lighten(@gray-lighter, 10);
  padding: 8px 12px 7px;
  position: relative;
  border-radius: 3px;
  color: @gray-dark;

  &.disabled {
    border: 1px solid @trim;
    background: #f7f8f9;
    color: @gray-dark;
  }

  .placeholder(@gray-light);

  &:focus {
    border-color: darken(@gray-lighter, 4);
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.04), 0 0 6px rgba(177, 171, 225, 0.3);
    outline: none;
  }

  object {
    position: absolute;
    top: 10px;
    right: 9px;
  }
}

.control-label.requiredField,
.form-stacked .required .controls label {
  &:after {
    margin-left: 10px;
    vertical-align: bottom;
    content: '[required]';
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
  }

  // Hide the crispy-forms required asterisk
  .asteriskField {
    display: none;
  }
}

.form-stacked .required .controls .radio label {
  // it should only appear on the first label (e.g. multi inputs)
  &:after {
    content: '';
  }
}

.form-group,
.control-group {
  margin-bottom: 15px;
}

.rate-limit-group {
  .control-group {
    margin-bottom: 0;
  }
}

.form-actions {
  border-top: 1px solid #e9ebec;
  background: none;
  padding: 20px 0 0;
  margin-bottom: 20px;

  p {
    padding: 0;
    line-height: 15px;
  }
  .note {
    color: @gray;
    line-height: 30px;
  }
}

.help-block {
  font-weight: normal;
  color: @gray;
  font-size: 90%;
  margin-bottom: 0;
}

textarea.form-control {
  height: 150px;
  min-height: 150px;
  min-width: 100%;
  max-width: 100%;
}

legend {
  margin: 20px 0;
  border-bottom: 1px solid #e9ebec;
  padding-bottom: 10px;
}

.inputs-list label {
  padding-left: 18px;
}

.inputs-list label input[type='radio'],
.inputs-list label input[type='checkbox'] {
  float: left;
  margin-left: -18px;
}

label {
  font-weight: 600;

  &.checkbox,
  &.radio {
    padding-left: 25px;
    position: relative;

    input[type='checkbox'] {
      top: 1px;
      left: 0;
      margin-left: 0 !important;
    }
  }
}

.boolean-radio-select .inputs-list ul {
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;

  li {
    margin-bottom: 5px;
    &:last-child {
      margin-bottom: 0;
    }
    label {
      font-weight: normal;
    }
  }
}

.radio,
.checkbox {
  label {
    font-weight: 600;
  }
}

.has-error .form-control {
  border-color: #c9c0d1;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.04);
}

.has-error .form-control:focus {
  border-color: #a598b2;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.04), 0 0 6px rgba(177, 171, 225, 0.3);
  outline: none;
}

.error,
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline,
.has-error.radio label,
.has-error.checkbox label,
.has-error.radio-inline label,
.has-error.checkbox-inline label {
  color: @red;
}

input.form-control[disabled],
textarea.form-control[disabled] {
  background: #f9f9f9;
  color: #999;
}

.disabled-indicator {
  margin-left: 5px;
  font-size: 80%;
}

.form-password {
  &.editing {
    div:first-child {
      width: 85%;
      display: inline-block;
    }
    div:last-child {
      line-height: 37px;
      margin-left: 10px;
      display: inline-block;
    }
  }

  &.saved {
    a {
      margin-left: 10px;
    }
  }
}

.deploy-form {
  display: flex;
  align-items: baseline;
  justify-content: space-between;

  .controls {
    display: flex;
    align-items: baseline;
    justify-content: space-around;
  }
}
